package com.vodone.v1pin.user.vo
{
	import mx.collections.ArrayCollection;

	[Bindable]
	public class MyGoodsListVO
	{
		/**
		 * 购物袋列表 
		 */		
		public var goodsList:ArrayCollection;
		/**
		 * 购物袋商品总价 
		 */		
		public var amount:Number = 0;
		public function MyGoodsListVO( obj:Object = null )
		{
			
			if( null != obj )
			{
				parseData( obj );
			}
		}
		
		private function parseData( obj:Object ):void
		{
			var tempAC:Array = [];
			if( obj.hasOwnProperty("data") )
			{
				var temp:Array = obj["data"];
				var len:int = temp.length;
				for(var i:uint=0;i<len;i++){
					var goods:MyGoodsVO = new MyGoodsVO( temp[i] );
					if( goods.v1Price != 0 ){
						amount += goods.v1Price;
					}else{
						amount += goods.price;
					}
					tempAC.push( goods );
				}
				goodsList = new ArrayCollection( tempAC );
			}
		}
	}
}